package com.sdlh.demo.pattern.strategy;

public abstract class AbstractPaymentStrategy implements IPaymentStrategy {
    public final void commonPay(double amount) {
        check(amount);
        pay(amount);
    }

    private void check(double amount) {
        if (amount <= 0) {
            throw new IllegalArgumentException("支付金额不能小于等于0");
        }
    }
}
